#ifndef BOOK_H
#define BOOK_H

#include <QWidget>
#include <QListWidget>//列表
#include <QPushButton>
#include <QHBoxLayout>
#include <QVBoxLayout>
#include "protool.h"
#include <QString>
#include <QTimer>//定时器

class Book : public QWidget
{
    Q_OBJECT
public:
    explicit Book(QWidget *parent = nullptr);
    void updateFileList(const PDU * pdu);
    void clearEnterDir();
    QString enterDir();
    void setDownloadStatus(bool status);

    qint64 m_iTotal;        //总文件大小
    qint64 m_iReceived;     //接收到的文件大小
    bool getDownloadStatus();
    QString getSaveFilePath();
    QString getShareFileName();


signals:

public slots:
    void createDir();
    void flushFile();
    void returnPre();
    void delDir();
    void renameFile();
    void enterDir(const QModelIndex &index);
    void uploadFile();

    void uploadFileData();
    void delRegFile();
    void downloadFile();
    void shareFile();
    void moveFile();
    void selectDestDir();


private:
    QListWidget *m_pBookListW;
    QPushButton *m_pReturnPB;//返回
    QPushButton *m_pCreateDirPB;
    QPushButton *m_pDelPB;//删除
    QPushButton *m_pRenamePB;//重命名
    QPushButton *m_pFlushPB;//查看文件
    QPushButton *m_pUploadPB;
    QPushButton *m_pDownloadPB;
    QPushButton *m_pDelFilePB;
    QPushButton *m_pShareFilePB;
    QPushButton *m_pMoveFilePB;
    QPushButton *m_pSelectDirPB;

    QString m_strEnterDir;
    QString m_strUploadFilePath;//保存打开的路径

    QTimer *m_pTimer;
    QString m_strSaveFilePath;
    bool m_bDownload;
    QString m_strShareFileName;
    QString m_strMoveFileName;
    QString m_strMoveFilePath;
    QString m_strDestDir;

};

#endif // BOOK_H
